    (function() {
        var suggestionFormat = "Search {0} in Microsoft Support";
        var wayfinder = new Microsoft.Support.GSS.WayFinder("#wayfinder", {
            enable: false,      // we need disabled wayfinder first till document is ready.
            language: 'en-us',
            path: '',
            isFullTopicPath: false,
            topicKeys: ['', ''],
            isRTL: false
        });
        var hasTopSearch = $("#gsfx_bsrch_query").length > 0;
        if(hasTopSearch) {
            $(wayfinder).bind("modalityselect", function(evt, modalityData, srcEvt) {
                srcEvt.preventDefault();
                if (modalityData.type !== "SelfHelp") {
                    removeGpsSearchFromSearchOptions("?");
                } else {
                    var productNode = wayfinder.getCurrentProduct();
                    var productName = productNode ? productNode.get("name") : "";
                    if (productName !== "" && productNode.get("props").productId) {
                        var siteName = suggestionFormat.replace(new RegExp('\\{0\\}', 'gm'), productName);
                        AddGpsSearchToSearchOptions(siteName, '?');
                    } else {
                        removeGpsSearchFromSearchOptions("?");
                    }
                }
            }).bind("productselect", function(evt, productNode, srcEvt) {
                var productName = productNode.get("name");
                var siteName = suggestionFormat.replace(new RegExp('\\{0\\}', 'gm'), productName);
                if (this.getCurrentModality().type === "SelfHelp" && productNode.get("props").productId) {
                    AddGpsSearchToSearchOptions(siteName, '?');
                } else {
                    removeGpsSearchFromSearchOptions("?");
                }
            });
        }
        window._wayfinder = wayfinder;
        $(function() {
            wayfinder.enable();
        });
    })();